package com.eco.common.response;

public enum ResponseCodeEnum {
    SUCCESS(0, "成功"),
    SUCCESS_ASYNC(202, "一个请求已经进入后台排队（异步任务）"),
    SUCCESS_DEL(204, "删除数据成功"),
    NO_ACCESS(401, "用户没有权限（令牌、用户名、密码错误）"),
    NOT_FIND(404, "资源不存在"),
    ERROR(-1, "服务内部异常"),
    WARNING(-2, "服务发生错误"),
    ERROR_GATEWAY(502, "网关错误"),
    SERVER_NOT_AVAILABLE(503, "服务不可用，服务器暂时过载或维护"),
    GATEWAY_TIMEOUT(504, "网关超时");

    private int code;
    private String message;

    private ResponseCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
}
